feat: make hook hint deep links clickable using OSC 8 terminal hyperlinks#13734
feat: make hook hint deep links clickable using OSC 8 terminal hyperlinks#13734
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the Compose hook “next steps” hint to render the Docker Desktop logs deep link as a clickable OSC 8 terminal hyperlink (with underline styling), while suppressing escape sequences when ANSI output is disabled via NO_COLOR or COMPOSE_ANSI=never.
Changes:
- Added
Osc8Linkhelper to generate OSC 8 hyperlinks when ANSI is enabled. - Updated hook hint templates to use hyperlink-wrapped deep links, gated by env-based ANSI suppression.
- Added unit tests for OSC 8 link formatting and hook output under ANSI-enabled/disabled conditions.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| cmd/formatter/ansi.go | Adds OSC 8 hyperlink helper and improves lenAnsi documentation. |
| cmd/formatter/ansi_test.go | Adds tests validating OSC 8 hyperlink output and ANSI-disabled behavior. |
| cmd/compose/hooks.go | Converts hint templates to functions and wraps the deep link using OSC 8 when allowed. |
| cmd/compose/hooks_test.go | Updates existing expectations and adds tests for OSC 8 presence/absence based on env. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
0249bfa to
6734d5e
Compare
|
The |
…inks Wrap the docker-desktop://dashboard/logs URL in OSC 8 escape sequences with underline styling so it appears as a clickable link in supported terminals. Respects NO_COLOR and COMPOSE_ANSI=never to suppress escapes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Guillaume Lours <glours@users.noreply.github.com>
6734d5e to
821d3a6
Compare
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [docker/compose](https://github.com/docker/compose) | patch | `v5.1.2` → `v5.1.3` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>docker/compose (docker/compose)</summary> ### [`v5.1.3`](https://github.com/docker/compose/releases/tag/v5.1.3) [Compare Source](docker/compose@v5.1.2...v5.1.3) #### What's Changed ##### 🐛 Fixes - fix: provider output handling and watch rebuild re-invocation by [@​glours](https://github.com/glours) in [#​13732](docker/compose#13732) ##### 🔧 Internal - Add Docker Desktop Logs view hints and navigation shortcut by [@​glours](https://github.com/glours) in [#​13721](docker/compose#13721) - Build and push Docker Desktop module image on release by [@​glours](https://github.com/glours) in [#​13726](docker/compose#13726) - Fix typo in SECURITY.md by [@​glours](https://github.com/glours) in [#​13730](docker/compose#13730) - Make hook hint deep links clickable using OSC 8 terminal hyperlinks by [@​glours](https://github.com/glours) in [#​13734](docker/compose#13734) - Remove 'provenance' attribute' by [@​glours](https://github.com/glours) in [#​13738](docker/compose#13738) ##### ⚙️ Dependencies - build(deps): bump github.com/containerd/containerd/v2 from 2.2.2 to 2.2.3 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​13737](docker/compose#13737) **Full Changelog**: <docker/compose@v5.1.2...v5.1.3> </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xMjAuMSIsInVwZGF0ZWRJblZlciI6IjQzLjEyMC4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiLCJhdXRvbWF0aW9uOmJvdC1hdXRob3JlZCIsImRlcGVuZGVuY3ktdHlwZTo6cGF0Y2giXX0=-->
What I did
Wrap the docker-desktop://dashboard/logs URL in OSC 8 escape sequences with underline styling so it appears as a clickable link in supported terminals. Respects NO_COLOR and COMPOSE_ANSI=never to suppress escapes.
Related issue
N/A
(not mandatory) A picture of a cute animal, if possible in relation to what you did
